package com.firewolf.vue.security;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;

/**
 * 作者：刘兴
 * 时间:19/3/7
 **/
@Configuration
public class BeansConfiguration {

    @Bean
    public AuthenticationSuccessHandler authenticationSuccessHandler(){
        return new LXAhenticationSuccessHandler();
    }

    @Bean
    public AuthenticationFailureHandler authenticationFailureHandler(){
        return new LXAuthenticationFailHandler();
    }

    @Bean
    public UserDetailsService userDetailsService(){
        return new LXUserDetailService();
    }


    @Bean
    public LogoutSuccessHandler logoutSuccessHandler(){
        return new LXLogoutSuccessHandler();
    }
}
